<?php

/*
	Class: App_Request

	About: Author
		J William McCarthy

	About: License
		<http://communit.as/docs/license>
*/
class App_Request {

	/* Group: Constructors */

	/*
		Constructor: __construct

		Arguments:
			request - An HTTP Request object.

		Returns:
			void
	*/
 	function __construct($request){
 		$params = $request->getParams();
 		foreach ($params as $name => $param) {
			$param =  trim($param);
			if (strlen($param) == 0) {
 				$this->$name = null;
			} else {
 				$this->$name = $param;
			}
 		}
 	}

	/* Group: Instance Methods */

	/*
		Function: stripTags

		Arguments:
			properties - TBD

		Returns:
			void
	*/
 	function stripTags($properties) {
 		$tag_filter = new Zend_Filter_StripTags();
 		foreach ($properties as $property) {
 			$this->$property = $tag_filter->filter($this->$property);
 		}
 	}

	/*
		Function: has
			TBD

		Arguments:
			var - TBD

		Returns:
			boolean
	*/
 	function has($var) {
 		if (array_key_exists($var, get_object_vars($this))) {
 			return true;
 		} else {
 			return false;
 		}
 	}
}
